package android.support.v4.view;

import android.content.Context;
import android.util.AttributeSet;

/**
 * 界面ScrollView中Viewpager中Fragment的高度显示问题；
 *
 * @author HX1401049
 */
public class ScrollViewViewpager extends ViewPager {

    public ScrollViewViewpager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
//		int viewHeight = 0;
//		View childView = getChildAt(getCurrentItem());
//		childView.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
//		viewHeight = childView.getMeasuredHeight();
//		heightMeasureSpec = MeasureSpec.makeMeasureSpec(viewHeight, MeasureSpec.EXACTLY);

        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
}
